﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ServerYuGi;
using System.Threading;

namespace ReplayViewer
{
    class Program
    {
        public static SSupervisor sup = new SSupervisor("");
        public static LogReader log_reader;
        public static TimeLine time_line ;
        static void Main(string[] args)
        {
            log_reader = new LogReader(".\\Log\\2011-3-9-15-41-0-1.txt");
            
            sup.StartServer();

            int p_id;
            List<int> bobai= log_reader.ReadBoBai(out p_id);
            sup.Simulation_AddPlayer_Card(p_id, bobai);
            bobai = log_reader.ReadBoBai(out p_id);
            sup.Simulation_AddPlayer_Card(p_id, bobai);


            LogReader.LogItem item = log_reader.NextLogItem();
                sup.Sumilation_AddPlayer(item.getItem(1));
            item = log_reader.NextLogItem();
                sup.Sumilation_AddPlayer(item.getItem(1));

            List<int> bai_tay_p1,bai_tay_p2;
            log_reader.ReadBaiTrenTay(out bai_tay_p1,out bai_tay_p2);
            sup.Add_Simulate_CardInHand(bai_tay_p1, bai_tay_p2);


            time_line = new TimeLine(log_reader, sup);

            sup.SendMessageToServer(Common.YMSG.PLAYER_LOGIN, 0);
            Thread.Sleep(100);
            sup.SendMessageToServer(Common.YMSG.PLAYER_LOGIN, 1);

            
            Console.ReadLine();
            time_line.Start();
            while (true) ;
        } 
    }
}
